from app.utils.index import file2base64
import io
import json
import base64

imgFile = r"E:\workspace\machine-learning\yolo\测试\小程序原图-500\2oZhGBrhmRJ4lEWBnHrq9c8l7JV.jpg"
# imgFile = r"E:\workspace\machine-learning\yolo\测试\微信图片_20241129100242.png"

if __name__ == "__main__":
  base64 = file2base64(imgFile)
  with io.open("img_base64.txt", "w", encoding="utf-8") as file:
    r = {
      "base64": base64
    }
    file.write(json.dumps(r))
  # ret = hex_to_rgb("#00A3E6")
  # print(ret)
